//
//  gameListModel.m
//  PhotoCircle
//
//  Created by wujungao on 12/25/15.
//  Copyright © 2015 wujungao. All rights reserved.
//

#import "gameListModel.h"

@implementation gameListModel

-(instancetype)initGameListModelWithDict:(NSDictionary *)dict{
    
    self=[super init];
    if(self){
        
        [self configModelWithDict:dict];
    }
    
    return self;
}

-(void)configModelWithDict:(NSDictionary *)dict{
    
    if(dict[@"uuid"] != [NSNull null]){
        
        self.uuid=dict[@"uuid"];
    }
    
    if(dict[@"title"] != [NSNull null]){
        
        self.title=dict[@"title"];
    }
    
    if(dict[@"author"] != [NSNull null]){
        
        self.author=dict[@"author"];
    }
    
    if(dict[@"desc"] != [NSNull null]){
        
        self.desc=dict[@"desc"];
    }
    
    if(dict[@"image"] != [NSNull null]){
        
        self.imageURL=dict[@"image"];
    }
    
    if(dict[@"votes_count"] != [NSNull null]){
        
        self.votesCount=[dict[@"votes_count"] integerValue];
    }
    
    if(dict[@"created_at"] != [NSNull null]){
        
        self.createdAt=dict[@"created_at"];
    }
    
    if(dict[@"voted"] != [NSNull null]){
        
        self.voted=[dict[@"voted"] boolValue];
    }
}

@end
